<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="Hexo + Gitee&#x2F;Github 搭建个人博客一、 安装 Node.js 和 GitNode.js    自动安装完成即可 可以验证一下是否安装成功   已经安装过 Git，就不演示了  二、安装 Hexo1. 安装 Hexo修改使用淘宝链接进行安装 1npm install -g cnpm --registry&#x3D;https:&#x2F;&#x2F;registry.npm.taobao.org  开">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo">
<meta property="og:url" content="http://the_ring.gitee.io/blog/2022/07/30/Hexo%20+%20GiteeGithub%20%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="Hexo + Gitee&#x2F;Github 搭建个人博客一、 安装 Node.js 和 GitNode.js    自动安装完成即可 可以验证一下是否安装成功   已经安装过 Git，就不演示了  二、安装 Hexo1. 安装 Hexo修改使用淘宝链接进行安装 1npm install -g cnpm --registry&#x3D;https:&#x2F;&#x2F;registry.npm.taobao.org  开">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730210351312.png">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730210427462.png">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730210530475.png">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730210635122.png">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730211707199.png">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730212126969.png">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730212441470.png">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730212408521.png">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730213227646.png">
<meta property="og:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730214249131.png">
<meta property="article:published_time" content="2022-07-30T14:04:31.519Z">
<meta property="article:modified_time" content="2022-07-30T14:04:31.519Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="c:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730210351312.png">
  
    <link rel="alternate" href="/blog/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/blog/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/blog/css/style.css">

  
    
<link rel="stylesheet" href="/blog/fancybox/jquery.fancybox.min.css">

  
<meta name="generator" content="Hexo 6.2.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/blog/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/blog/">Home</a>
        
          <a class="main-nav-link" href="/blog/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/blog/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://the_ring.gitee.io/blog"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-Hexo + GiteeGithub 搭建个人博客" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/blog/2022/07/30/Hexo%20+%20GiteeGithub%20%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" class="article-date">
  <time class="dt-published" datetime="2022-07-30T14:04:31.519Z" itemprop="datePublished">2022-07-30</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <h1 id="Hexo-Gitee-x2F-Github-搭建个人博客"><a href="#Hexo-Gitee-x2F-Github-搭建个人博客" class="headerlink" title="Hexo + Gitee&#x2F;Github 搭建个人博客"></a>Hexo + Gitee&#x2F;Github 搭建个人博客</h1><h2 id="一、-安装-Node-js-和-Git"><a href="#一、-安装-Node-js-和-Git" class="headerlink" title="一、 安装 Node.js 和 Git"></a>一、 安装 Node.js 和 Git</h2><p><a target="_blank" rel="noopener" href="https://nodejs.org/en/">Node.js</a></p>
<p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730210351312.png" alt="image-20220730210351312"></p>
<p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730210427462.png" alt="image-20220730210427462"></p>
<p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730210530475.png" alt="image-20220730210530475"></p>
<p>自动安装完成即可</p>
<p>可以验证一下是否安装成功</p>
<p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730210635122.png" alt="image-20220730210635122"></p>
<blockquote>
<p>已经安装过 Git，就不演示了</p>
</blockquote>
<h2 id="二、安装-Hexo"><a href="#二、安装-Hexo" class="headerlink" title="二、安装 Hexo"></a>二、安装 Hexo</h2><h3 id="1-安装-Hexo"><a href="#1-安装-Hexo" class="headerlink" title="1. 安装 Hexo"></a>1. 安装 Hexo</h3><p>修改使用淘宝链接进行安装</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g cnpm --registry=https://registry.npm.taobao.org</span><br></pre></td></tr></table></figure>

<p>开始安装</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm install -g hexo-cli</span><br></pre></td></tr></table></figure>

<p>安装后验证</p>
<p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730211707199.png" alt="image-20220730211707199"></p>
<h3 id="2-初始化"><a href="#2-初始化" class="headerlink" title="2. 初始化"></a>2. 初始化</h3><p>使用</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo init</span><br></pre></td></tr></table></figure>

<blockquote>
<p>先创建一个目录用来保存 blog，再在此目录下执行此命令</p>
</blockquote>
<p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730212126969.png" alt="image-20220730212126969"></p>
<h3 id="3-启动"><a href="#3-启动" class="headerlink" title="3. 启动"></a>3. 启动</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s</span><br></pre></td></tr></table></figure>

<p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730212441470.png" alt="image-20220730212441470"></p>
<p>浏览器中使用 localhost:4000 即可访问</p>
<p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730212408521.png" alt="image-20220730212408521"></p>
<h2 id="三、-部署到-Gitee-x2F-Github"><a href="#三、-部署到-Gitee-x2F-Github" class="headerlink" title="三、 部署到 Gitee&#x2F;Github"></a>三、 部署到 Gitee&#x2F;Github</h2><p>这里使用 Gitee 进行演示</p>
<h3 id="1-Gitee-上创建一个仓库"><a href="#1-Gitee-上创建一个仓库" class="headerlink" title="1. Gitee 上创建一个仓库"></a>1. Gitee 上创建一个仓库</h3><p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730213227646.png" alt="image-20220730213227646"></p>
<h3 id="2-安装-Git-部署插件"><a href="#2-安装-Git-部署插件" class="headerlink" title="2. 安装 Git 部署插件"></a>2. 安装 Git 部署插件</h3><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cnpm install --save hexo-deployer-git</span><br></pre></td></tr></table></figure>



<h3 id="3-修改配置"><a href="#3-修改配置" class="headerlink" title="3. 修改配置"></a>3. 修改配置</h3><p>打开安装目录的 <code>_config.yaml</code> 文件</p>
<p>添加以下内容</p>
<p><img src="C:%5CUsers%5CTan%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20220730214249131.png" alt="image-20220730214249131"></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://the_ring.gitee.io/blog/2022/07/30/Hexo%20+%20GiteeGithub%20%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" data-id="cl67ytupm0000xoutfb8m1rb8" data-title="" class="article-share-link">Share</a>
      
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
  
    <a href="/blog/2022/07/30/%E6%96%B0%E7%9A%84%E4%B8%BB%E9%A2%98/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">新的主题</div>
    </a>
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/blog/archives/2022/07/">July 2022</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/blog/2022/07/30/Hexo%20+%20GiteeGithub%20%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/">(no title)</a>
          </li>
        
          <li>
            <a href="/blog/2022/07/30/%E6%96%B0%E7%9A%84%E4%B8%BB%E9%A2%98/">新的主题</a>
          </li>
        
          <li>
            <a href="/blog/2022/07/30/hello-world/">Hello World</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2022 John Doe<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/blog/" class="mobile-nav-link">Home</a>
  
    <a href="/blog/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    


<script src="/blog/js/jquery-3.4.1.min.js"></script>



  
<script src="/blog/fancybox/jquery.fancybox.min.js"></script>




<script src="/blog/js/script.js"></script>





  </div>
</body>
</html>